package com.c2soft.nepalcmx.webapp;



import javax.sql.DataSource;


import org.springframework.context.annotation.Bean;

import org.springframework.context.annotation.Configuration;


import org.springframework.jdbc.datasource.DriverManagerDataSource;



import com.c2soft.nepalcmx.dao.BrokeOrderMgmtDAO;

import com.c2soft.nepalcmx.dao.BrokeUserDAO;

import com.c2soft.nepalcmx.dao.BrokerAccountDetailDAO;

import com.c2soft.nepalcmx.dao.BrokerFormDAO;

import com.c2soft.nepalcmx.dao.NetPositionDAO;

import com.c2soft.nepalcmx.dao.OrderMgmtDAO;
import com.c2soft.nepalcmx.dao.ProfitLossDAO;
import com.c2soft.nepalcmx.dao.TradeBookDAO;
import com.c2soft.nepalcmx.dao.UserFormDAO;
import com.c2soft.nepalcmx.dao.AccountDetailDAO;
import com.c2soft.nepalcmx.dao.WithdrawlDAO;



@Configuration
public class JavaConfig {
	
	@Bean
	public DataSource dataSource() {
		DriverManagerDataSource dataSource = new DriverManagerDataSource();
		dataSource.setDriverClassName("com.mysql.jdbc.Driver");
		dataSource.setUrl("jdbc:mysql://localhost:3306/ncmxDb");
		dataSource.setUsername("ncmx");
		dataSource.setPassword("password");
		return dataSource;
	}
	
	@Bean
	public OrderMgmtDAO orderMgmtDAO() {
		return new OrderMgmtDAO();
	}

	@Bean
	public TradeBookDAO tradeBookDAO() {
		return new TradeBookDAO();
	}
	
	@Bean
	public UserFormDAO userformDAO(){
		return new UserFormDAO();
		
	}
	@Bean
	public BrokerFormDAO brokeformDAO(){
		return new BrokerFormDAO();
		
	}
	

	@Bean
	public AccountDetailDAO accountdetailDAO(){
		return new AccountDetailDAO();
		
	}
	
	@Bean
	public ProfitLossDAO profitLossDAO(){
		return new ProfitLossDAO();
		
	}
	
	@Bean
	public BrokerAccountDetailDAO brokerAccountdetailDAO(){
		return new BrokerAccountDetailDAO();
		
	}

	@Bean
	public BrokeUserDAO brokeUserDAO(){
		return new BrokeUserDAO();
		
	}
	
	@Bean
	public BrokeOrderMgmtDAO brokeOrderMgmtDAO(){
		return new BrokeOrderMgmtDAO();
		
	}
	
	@Bean
	public WithdrawlDAO WithdrawlDAO(){
		return new WithdrawlDAO();
		
	}

	@Bean
	public NetPositionDAO netPositionDAO(){
		return new NetPositionDAO();
		
	}
}
